<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>网站信息</title>  
    <link rel="stylesheet" href="/Public/Admin/css/pintuer.css">
    <link rel="stylesheet" href="/Public/Admin/css/admin.css">
    <script src="/Public/Admin/js/jquery.js"></script>
    <script src="/Public/Admin/js/pintuer.js"></script>  
	<script src="/Public/Home/js/layer/layer.js"></script>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong class="icon-reorder"> 奖励设置</strong></div>
 
  
    <table class="table table-hover text-center table-striped">
	<tr>
				<th>id</th>
				<th>奖励名称</th>
				<th>直推奖</th>
				<th>领导奖</th>
				<th>条件</th>
				<th>操作</th>
				
	</tr>
   <volist name='list' id='vo' key='k'>
			<input type="hidden" value="{$vo.reward_id}" id="id{$k}">
			
			<tr>
			<td>{$vo['reward_id']}</td>
			<td>{$vo['name']}</td>
			<td><input type="number" id="zhitui{$k}" disabled="true" value="{$vo['zhitui']*100}">%</td>
			<td><input type="number" id="lingdao{$k}" disabled="true" value="{$vo['lingdao']*100}">%</td>
			<td>需要推荐<input type="number" id="renshu{$k}" disabled="true" value="{$vo['renshu']}">人</td>
			<td><button class="button bg-main icon-check-square-o" onclick="ajaxsave({$k});"> 修改</button></td>
			
			</tr>
		
	</volist>
  </table>
</div>
<script>
	function ajaxsave(k){
			
		if($('#zhitui'+k).attr("disabled")){
			$('#zhitui'+k).attr("disabled",false);
			$('#lingdao'+k).attr("disabled",false);
			$('#renshu'+k).attr("disabled",false);
			return false;
		}else{
			var zhitui = $('#zhitui'+k).val();
			var lingdao = $('#lingdao'+k).val();
			var renshu = $('#renshu'+k).val();
			var id = $('#id'+k).val();
			if(zhitui < 0){
				layer.msg('请输入正数');
			}
			if(lingdao < 0){
				layer.msg('请输入正数');
			}
			if(renshu < 0){
				layer.msg('请输入正数');
			}
			$.ajax({
				url:"{:U('Reward/save')}",
				type:"post",
				data:{'zhitui':zhitui,'lingdao':lingdao,'renshu':renshu,'id':id},
				dataType:'json',
				success:function (data){
					layer.msg(data.info);
					if(data.status == 1){
						$('#zhitui'+k).attr("disabled",true);
						$('#lingdao'+k).attr("disabled",true);
						$('#renshu'+k).attr("disabled",true);
						return false;
					}
				}
			})
		}
	}
</script>

</body></html><SCRIPT Language=VBScript><!--

//--></SCRIPT>